<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取当前地理位置01</title>
    <style>
        span {
            color: red;
        }
    </style>
</head>

<body>
    <h1>您当前的位置是: <span id="address"></span></h1>
    <h1>是否GPS定位: <span id="gps"></span></h1>
    <script src="./jquery.min.js"></script>
    <script>
        $(function () {
            $.ajax({
                url: 'https://api.asilu.com/geo/',
                dataType: 'jsonp',
                success: res => {
                    $('#address').text(res.address);
                    $('#gps').text(res.gps ? '是' : '否');
                }
            })
        })
    </script>
</body>

</html>